﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessObjects.BO_GetObjects;

public partial class Controls_Gallery : Base_Controls
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Cid = getRequest("category_id", 0);
        base.setField(Convert.ToInt32(this.Attributes["ID"]));

        bindRepeater(rptheadmenu, BO_portal_categories.SelectByParent(Cid, 1));

        ObjDT = BO_portal_galleries.SelectWithPaged(base.Cur_page, base.PSize, 1);
        base.bindRepeater(rptGallery, ObjDT, pagerContainer);
    }

    protected string getFirstImage(string gallery_id)
    {
        ObjDT = BO_portal_galleries_details.SelectByGallery(1, 1, 1, Convert.ToInt32(gallery_id));
        if (ObjDT.Rows.Count > 0)
        {
            return ObjDT.Rows[0]["PICTURE_PATH"].ToString();
        }
        else
            return "";
    }
}